package com.sgb.goods.entity;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * 各种筛选共用实体(五花八门)
 *
 * @author cyj
 */
public class DictEntity extends RecordPointEntity implements Cloneable, IPickerViewData {

    @SerializedName("haveSpec")
    public boolean haveSpec;
    @SerializedName(value = "param", alternate = {"commentCount"})
    public String param;
    @SerializedName(value = "id", alternate = {"cid", "no", "key", "count", "code"})
    public String id;
    @SerializedName(value = "name", alternate = {"areaName", "cname", "value", "projectscale", "distance", "lastMsgTime"})
    public String name;
    @SerializedName("latitude")
    public String latitude;
    @SerializedName("longitude")
    public String longitude;
    @SerializedName(value = "spec", alternate = {"vals"})
    public List<DictEntity> datas;
    public boolean childCheck = false;   //商砼外加剂时候用
    public String startVal;
    public String endVal;
    public String unit;
    public int type;
    public String icon;

    public boolean checked = false;

    public DictEntity() {
    }

    public DictEntity(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public DictEntity(String id, String name, List<DictEntity> list) {
        this.id = id;
        this.name = name;
        this.datas = list;
    }

    @Override
    public DictEntity clone() {
        try {
            return (DictEntity) super.clone();
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public String getPickerViewText() {
        return name;
    }
}
